package de.gameduell.framework.asset {
	import de.gameduell.framework.debug.Debug;
	import de.gameduell.framework.util.Tools;
	
	import flash.events.Event;	

	/**
	 * @author GD
	 */
	public class XMLAsset extends TextAsset {

		public function XMLAsset(aId:String, aUrl:String) {
			super(aId, aUrl);
			_type  = AssetTypes.XML;
		}

		public function get xmlData():XML{
			var xml:XML = new XML();
			try{
				xml = XML(data);
			}catch(e:Error){
				Debug.trace("XMLAsset::xmlData: ERROR " + e.getStackTrace(), Debug.ERROR);
				Tools.traceToFrontend("Error xml malformed "+id);
			}
			return xml;
		}	
		
		override protected function complete(event:Event = null):void {
			super.complete(event);
		}
	}
}
